for i in range(100,1000):#只考虑三位数
   digits=[int (d)for d in str(i)];
   if digits[0]**3+digits[1]**3+digits[2]**3==i:
      print(i);


rows=5;
for i in [1,3,5,7,5,3,1]:
    print('*'*i)


for i in [1,2,3,4,5,6,7,8,9]:
    print("\t");
    for j in [1,2,3,4,5,6,7,8,9]:
        sum=i*j;
        print(sum);


def perfect_number(n):
    sum_of_divsions=0;
    for i in (1,n):
        if n%i==0:
          sum_of_divsions+=i;
    return sum_of_divsions==n;
#测试语句：
for n in range (1,10001):#可以调整数据范围
     if perfect_number(n):
         print(n);



def is_prime(num):
    if num<=1:
        return False;
    if num>=2:
        for i in range(2,num):
            if num%i==0:
                return False;
        return True;
#打印质数
def print_prime(max_num):
    for i in range(2,max_num+1):
        if is_prime(i):
            print(i);
#打印质数：
print_prime(max_num=100)



def fibonacci(n):
    # 初始化前两项
    fib_list = [0, 1]
    # 循环n-2次，生成斐波那契数列
    for i in range(2, n):
        fib_list.append(fib_list[i - 1] + fib_list[i - 2])
    # 打印斐波那契数列
    for item in fib_list[:n]:
        print(item, end=" ")

# 调用斐波那契方法
n = 10
fibonacci(n)